from pyquery import PyQuery as pq

html = '''
<div>
    <ul class='list>
         <li class="item-0">first item</li>
         <li class="item-1"><a href="link2.html">second item</a></li>
         <li class="item-0 active"><a href="link3.html"><span class="bold">third item</span></a></li>
         <li class="item-1 active"><a href="link4.html">fourth item</a></li>
         <li class="item-0"><a href="link5.html">fifth item</a></li>
     </ul>
 </div>
'''

doc = pq(html)
items = doc('.list')
print(type(items))
print(items)

lis = items.find('li')
print(type(lis))
print(lis)

lis1 = items.children()
print(type(lis1))
print(lis1)

lis2 = items.children('.ative')
print(lis2)

lis3 = items.parent()
print(type(lis3))
print(lis3)

lis4 = items.parents()
print(type(lis4))
print(lis4)

#兄弟节点
lis5 = items.siblings()
print(type(lis5))
print(lis5)